<?php
$sql="CREATE TABLE IF NOT EXISTS `ims_nbs_scdy_jl` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `openid` varchar(100) NOT NULL,
  `msg` varchar(255) NOT NULL COMMENT '描述',
  `createtime` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `weid` (`weid`),
  KEY `openid` (`openid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_nbs_scdy_zjjl` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `openid` varchar(100) NOT NULL,
  `nickname` varchar(100) NOT NULL,
  `avatar` varchar(255) NOT NULL,
  `credit1` int(11) unsigned NOT NULL,
  `credit2` decimal(10,2) NOT NULL DEFAULT '0.00',
  `msg` varchar(200) NOT NULL,
  `createtime` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `weid` (`weid`),
  KEY `openid` (`openid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
";
pdo_run($sql);
if(!pdo_fieldexists('nbs_scdy_jl',  'id')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD `id` int(10) unsigned NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists('nbs_scdy_jl',  'weid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD `weid` int(10) unsigned NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_jl',  'openid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD `openid` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_jl',  'msg')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD `msg` varchar(255) NOT NULL COMMENT '描述';");
}
if(!pdo_fieldexists('nbs_scdy_jl',  'createtime')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD `createtime` int(10) NOT NULL;");
}
if(!pdo_indexexists('nbs_scdy_jl',  'weid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD KEY `weid` (`weid`);");
}
if(!pdo_indexexists('nbs_scdy_jl',  'openid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_jl')." ADD KEY `openid` (`openid`);");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'id')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `id` int(10) unsigned NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'weid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `weid` int(10) unsigned NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'openid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `openid` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'nickname')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `nickname` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'avatar')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `avatar` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'credit1')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `credit1` int(11) unsigned NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'credit2')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `credit2` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'msg')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `msg` varchar(200) NOT NULL;");
}
if(!pdo_fieldexists('nbs_scdy_zjjl',  'createtime')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD `createtime` int(10) NOT NULL;");
}
if(!pdo_indexexists('nbs_scdy_zjjl',  'weid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD KEY `weid` (`weid`);");
}
if(!pdo_indexexists('nbs_scdy_zjjl',  'openid')) {
	pdo_query("ALTER TABLE ".tablename('nbs_scdy_zjjl')." ADD KEY `openid` (`openid`);");
}

?>